﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeFile="CompanyInfo.aspx.cs" Inherits="Company_CompanyInfo" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <h2>
        公司详情</h2>
    <asp:FormView ID="FormView1" runat="server" DataKeyNames="CompanySerialNumber" DataSourceID="SqlDataSource1">
        <EditItemTemplate>
        </EditItemTemplate>
        <InsertItemTemplate>
        </InsertItemTemplate>
        <ItemTemplate>
            <table class="commoninfo">
                <tr>
                    <td style="width: 100px;">
                        公司编号
                    </td>
                    <td>
                        <asp:Label ID="公司编号Label" runat="server" Text='<%#Bind("公司编号")%>' />
                    </td>
                </tr>
                <tr>
                    <td>
                        公司英文名
                    </td>
                    <td>
                        <asp:Label ID="公司英文名Label" runat="server" Text='<%#Bind("公司英文名")%>' />
                    </td>
                </tr>
                <tr>
                    <td>
                        公司中文名
                    </td>
                    <td>
                        <asp:Label ID="公司中文名Label" runat="server" Text='<%#Bind("公司中文名")%>' />
                    </td>
                </tr>
                <tr>
                    <td>
                        注册地
                    </td>
                    <td>
                        <asp:Label ID="注册地Label" runat="server" Text='<%#Bind("注册地")%>' />
                    </td>
                </tr>
                <tr>
                    <td>
                        董事长
                    </td>
                    <td>
                        <asp:Label ID="董事长Label" runat="server" Text='<%#Bind("董事长")%>' />
                    </td>
                </tr>
                <tr>
                    <td>
                        注册股份
                    </td>
                    <td>
                        <asp:Label ID="注册股份Label" runat="server" Text='<%#Bind("注册股份")%>' />
                    </td>
                </tr>
                <tr>
                    <td>
                        注册日期
                    </td>
                    <td>
                        <asp:Label ID="注册日期Label" runat="server" Text='<%#Bind("注册日期")%>' />
                        <asp:Label ID="CompanySerialNumberLabel" runat="server" Text='<%#Eval("CompanySerialNumber")%>'
                            Visible="false" />
                    </td>
                </tr>
            </table>
        </ItemTemplate>
    </asp:FormView>
    <h3>
        历史交易记录</h3>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="ClientID"
        DataSourceID="SqlDataSource2" CssClass="commongv">
        <Columns>
            <asp:HyperLinkField DataNavigateUrlFields="ClientID" DataNavigateUrlFormatString="~/Client/ClientDetail.aspx?ID={0}"
                DataTextField="客户名" HeaderText="客户名" />
            <asp:BoundField DataField="客户类型" HeaderText="客户类型" ReadOnly="True" SortExpression="客户类型" />
            <asp:BoundField DataField="下单时间" HeaderText="下单时间" SortExpression="下单时间" DataFormatString="{0:yyyy-MM-dd}" />
            <asp:BoundField DataField="金额" HeaderText="金额" SortExpression="金额" DataFormatString="{0:0}" />
            <asp:BoundField DataField="币种" HeaderText="币种" SortExpression="币种" />
            <asp:BoundField DataField="备注" HeaderText="备注" SortExpression="备注" />
            <asp:BoundField DataField="业务类型" HeaderText="业务类型" SortExpression="业务类型" />
            <asp:BoundField DataField="分行" HeaderText="分行" SortExpression="分行" />
            <asp:BoundField DataField="业务员" HeaderText="业务员" SortExpression="业务员" />
            <asp:BoundField DataField="ClientID" HeaderText="ClientID" ReadOnly="True" SortExpression="ClientID"
                Visible="false" />
            <asp:BoundField DataField="CompanySerialNumber" HeaderText="CompanySerialNumber"
                SortExpression="CompanySerialNumber" Visible="false" />            
            <asp:TemplateField HeaderText="订单轨迹">
                <ItemTemplate>
                    <asp:HyperLink ID="OrderTrack" runat="server" 
                        NavigateUrl='<%# Eval("OrderID", "../Order/GetOrderTracksByOrderID.aspx?OrderID={0}") %>'>轨迹</asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:KOONCRMDB %>"
        SelectCommand="SELECT * FROM [GetTransactionInfo] WHERE (cast(CompanySerialNumber as nvarchar(36)) = @CompanySerialNumber) and status not in (11,13)">
        <SelectParameters>
            <asp:QueryStringParameter DefaultValue="" Name="CompanySerialNumber" QueryStringField="ID"
                Type="Object" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:KOONCRMDB %>"
        SelectCommand="SELECT * FROM [GetCompanies] WHERE (Cast(CompanySerialNumber as nvarchar(36))= @CompanySerialNumber)">
        <SelectParameters>
            <asp:QueryStringParameter Name="CompanySerialNumber" QueryStringField="ID" Type="Object" />
        </SelectParameters>
    </asp:SqlDataSource>
</asp:Content>
